import { ModifyAction } from '../actions';

export interface HomeInfoState {
    name: string
}

const defaultHomeInfo = {
    name: ''
}
export const homeInfo = (state: HomeInfoState = defaultHomeInfo, action: ModifyAction) => {
    const { type, payload } = action;
    switch (type) {
        case 'SET_HOME_INFO':
            return {
                ...state,
                ...payload
            }
            break;
    
        default:
            return state
            break;
    }
}